super(section, connection);
this._label.x_expand = true;
+ this.radioMode = true;
this._switch = new PopupMenu.Switch(this.is_active);
this.add_child(this._switch);
this);
this._loadInitialItems();
- this._sync();
}
_loadInitialItems() {
for (const a of activeConnections)
this._items.get(a.connection)?.setActiveConnection(a);
-
- this._sync();
}
_shouldHandleConnection(connection) {
this._items.set(connection, item);
const pos = this._itemSorter.upsert(item);
this._section.addMenuItem(item, pos);
-
- this._sync();
}
_removeConnection(connection) {
this._items.delete(connection);
item.destroy();
- this._sync();
- }
-
- _sync() {
- const nItems = this._items.size;
- for (const item of this._items.values())
- item.radio_mode = nItems > 1;
}
get category() {